<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>[{$model['title']}] 列表</h2>
    </div>
	<div class="cf top_nav_list">
		<div class="fl button_list">
		<empty name="model.extend">
                    <div class="tools">
                        <!-- <button class="btn ajax-post confirm" target-form="ids" url="{:U('del?model='.$model['id'])}">删 除</button> -->
                        <button class="btn ajax-post gre" target-form="ids" url="{:U("Message/set_status",array("status"=>1,"msg_type"=>7,"field"=>"status"))}">修 复</button>
                        <button class="btn ajax-post red" target-form="ids" url="{:U("Message/set_status",array("status"=>0,"msg_type"=>8,"field"=>"status"))}">未修复</button>
                    </div>
		</empty>
		</div>
		<!-- 高级搜索 -->
		<div class="search-form fr cf">
                {:W('Search/game_list')}
                    <div class="sleft">
                        <input type="text" name="op_account" class="search-input" value="{:I('op_account')}" placeholder="请输入操作人员">
                        <a class="sch-btn" href="javascript:;" id="search" url="{:U('Message/wrong')}"><i class="btn-search">搜索</i></a>
                    </div>
		</div>
	</div>


    <!-- 数据列表 -->
    <div class="data-table">
        <div class="data-table table-striped">
            <table>
                <!-- 表头 -->
                <thead>
                    <tr>
                        <th  style="text-align:center"  class="row-selected row-selected">
                            <input class="check-all" type="checkbox">
                        </th>
                        <th style="text-align:center">编号</th>
                        <th style="text-align:center">游戏名称</th>
                        <th style="text-align:center">错误内容</th>
                        <th style="text-align:center">提交时间</th>
                        <th style="text-align:center">修复状态</th>
                        <th style="text-align:center">操作人</th>
                    </tr>
                </thead>

                <!-- 列表 -->
                
                <tbody>
                    <volist name="list_data" id="data">
                        <tr>
                            <td style="border-right:1px solid #DDDDDD;text-align:center"><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]" </td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center">{$data['id']}</td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center">{:get_game_name($data['game_id'])}</td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center" data-text="{$data['title']}" class="js-pop">{:get_title($data['title'])}</td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center">{:set_show_time($data['create_time'])}</td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center"><if condition="$data.status eq 1">已修复<else/>未修复</if></td>
                            <td style="border-right:1px solid #DDDDDD;text-align:center">{$data['op_account']}</td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page">
        {$_page|default=''}
    </div>
</block>

<block name="script">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Message/wrong')}');
$(function(){
        // 弹窗
        $('.js-pop').on('click',function() {
            var text = $(this).data('text');
            //墨绿深蓝风
            layer.alert(text, {
              skin: 'layui-layer-lan' //样式类名
              ,closeBtn: 0
            });
        });
        
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
        
        

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

})
</script>
</block>
